@{
    var Lead = Model.String(BlogKeys.Lead);
    var Published = Model.Get<DateTime>(BlogKeys.Published);   
    var Tags = Model.Get<string[]>(BlogKeys.Tags);
}

<div class="post-heading">
    <h1>@Model.WithoutSettings.String(BlogKeys.Title)</h1>
    @if(!string.IsNullOrWhiteSpace(Lead))
    {
        <h2 class="subheading">@Lead</h2>
    }            
    <div class="meta">        
        @if (Published != default(DateTime))
        {
            <text>Published on @Published.ToLongDateString(Context)<br></text>
        }
    </div>
    @if (Tags != null)
    {
        <div class="tags">
            @foreach (string tag in Tags.OrderBy(x => x))
            {
                IDocument tagDocument = Documents[Blog.Tags].FirstOrDefault(x => x.String(BlogKeys.Tag) == tag && x.Get<int>(Keys.CurrentPage) == 1);
                if(tagDocument != null)
                {                
                    <a role="button" href="@Context.GetLink(tagDocument)" class="btn btn-default btn-xs">@tag</a>
                }
            }
        </div>     
    } 
</div>